<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel=stylesheet type=text/css href=dlg.css>
</head>
<style>
#av{
padding:5px;
border:1px solid #BBB;
margin-top:2px;
overflow:scroll;
height:170px;
line-height:22px;
}
#av p{border-top:1px solid #BBB;}
#av u{float:right;}
p{margin:0;}
</style>
<body>
<div id=main>
<div id=TB></div>
<div id=Ddiv>
<span>链接地址：</span> <input id=add style=margin:5px;width:100%>
</div>
<div id=Bdiv><input type=button value=" 确定 " onclick=OK()> <input type=button value=" 关闭 " onclick=Cancel()></div>
</div>
</body>
</html>

<script src=../../w/av.js language=javascript></script>
<script src=../../w/avi.js language=javascript></script>
<script language=javascript>

function C(t){return document.createElement(t)}
function A(o,t){o.appendChild(t)}

var P=parent,curM=0,
IE=navigator.appName.indexOf("Mi")!=-1

for(i=0,d=["连接","邮件","图片","音视频","视频"];i<d.length;i++){
A(TB,t=C("a"))
t.className="tS"
if(!IE)t.style.marginTop=15
A(TB,t=C("a"))
t.className=i?"tM":"sM"
if(!i)curM=t
t.onclick=selM
t.href="javascript:;"
t.innerHTML=d[i]
curI=t.d=i
}
A(TB,t=C("a"))
t.className="tS"
if(!IE){t.style.marginTop=15;Ddiv.style.height=Ddiv.offsetHeight-45}
t.style.width=TB.clientWidth-t.offsetLeft-(IE?0:4)
function selM(){
if(curM==this)return false
if(curM)curM.className="tM"
this.className="sM"
if(curM.d>2){if(curM.d==3)z=x.checked;Ddiv.removeChild(Ddiv.lastChild)}
curM=this
if(curM.d>2)(curM.d==3?mus:mov)()
add.focus()
return false
}

var aT,vT,O,H,z=true
i1=["MP3","OGG"]
i2=["FLV, F4V, MP4","OGG, MP4, WEBM"]

function Z(){I.innerHTML=(x.checked?i1:i2)[O.value]}
function cr(){
a=C('div')
if(curM.d==3){
a.innerHTML="推荐播放器"
A(a,O=C('select'))
for(i=0,d=["Flash Player","HTML"];i<d.length;i++){A(O,c=C("option"));c.value=i;c.innerHTML=d[i]}
A(a,H=C('span'))
H.innerHTML+="&nbsp;<input id=x type=radio onclick=Z() checked name=tt>音频 <input id=X type=radio name=tt onclick=Z()>视频<p><br>相关文件格式 <span  id=I>"+i1[0]
O.onchange=Z
}else{a.innerHTML="<div id=av>支持视屏网"+vid;if(!IE)a.firstChild.style.height="160px"}
return a
}

mus=function(){aT=cr();mus=function(){A(Ddiv,aT);(z?x:X).checked=true};mus()}
mov=function(){vT=cr();mov=function(){A(Ddiv,vT)};mov()}
function fixN(s){return s.length&1?"0"+s:s}
function OK(){var i=curM.d,s=add.value.replace(/(^\s*)|(\s*$)/g,"").replace(/[\0-\x1f\x7f]/g,function(c){return "%"+fixN(c.charCodeAt(0).toString(16))})
if(!i&&s.charAt()==':'||!s){alert("地址非法，不能"+(s?"以 : 开头!":"空!"));add.focus()}else
if(4==i){
v=0
p=s.indexOf("/",7)
o=s.substr(0,p).toUpperCase()
if(o.substr(0,7)=="HTTP://")for(o=o.substr(7);v<avs.length;v++)if(avs[v]==o)break
if(!v||v==avs.length){alert("视频地址不在支持视频网站范围内!\n或者输入地址有误。");add.focus();return false}
}
if(i==2)P.insImg(s)
else P.linkc("CreateLink",false,(i==1?"mailto:":i==3?":"+String.fromCharCode(parseInt(O.value)+(X.checked?65:97)):i==4?":+":"")+s)
return false
}
function Cancel(){P.editMenus.L.style.top=-1000;return false}
</script>